package org.example.skytool.mq.rabbitmq;

import lombok.extern.slf4j.Slf4j;
import org.example.annotation.LogTrace;
import org.example.config.RabbitMqConfig;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 22449
 */
@Service
@Slf4j
public class PostCacheSender {


    @Autowired
    private RabbitTemplate rabbitTemplate;

    /**
     * 发送消息
     * @param message
     */
    @LogTrace
    public void sendStuInfoMessage(String message){
        rabbitTemplate.convertAndSend(RabbitMqConfig.POST_EXCHANGE,RabbitMqConfig.POST_ROUTING_KEY+"message",message);
    }

}
